import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    // host: '33b7e167.r23.cpolar.top',
    port: 8001,
    proxy: {
      '/apiGugo': {
        target: 'http://www.google.cn',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/apiGugo/, ''),
      },
      '/apiWeixing': {
        target: 'http://mt1.google.cn',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/apiWeixing/, ''),
      },
      '/apiCesium': {
        // https://sandcastle.cesium.com
        target: 'https://sandcastle.cesium.com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/apiCesium/, ''),
      },
    },
  },
});
